package com.yifei.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.yifei.base.IBaseEnum;
import lombok.Getter;

/**
 * @Description: 限流类型
 * @Author: yiFei
 * @date: 2023/11/1 19:21
 */
public enum LimitTypeEnum implements IBaseEnum<Integer> {
    /*
        userId:classSimpleName-methodName
     */
    USER_ID(0, "用户ID"),
    /*
        ip:classSimpleName-methodName
     */
    IP(1, "IP"),
    /*
        :classSimpleName-methodName
     */
    GLOBAL(2, "全局");

    @Getter
    @EnumValue //  Mybatis-Plus 提供注解表示插入数据库时插入该值
    private Integer value;

    @Getter
    @JsonValue //  表示对枚举序列化时返回此字段
    private String label;

    LimitTypeEnum(Integer value, String label) {
        this.value = value;
        this.label = label;
    }

}
